﻿using Castle.DynamicProxy;

namespace CastleInterceptorDemo.Api
{
    public class LogInterceptor : IInterceptor
    {
        private readonly LogAsyncInterceptor _logAsyncInterceptor;

        public LogInterceptor(LogAsyncInterceptor logAsyncInterceptor)
        {
            _logAsyncInterceptor = logAsyncInterceptor;
        }

        public void Intercept(IInvocation invocation)
        {
            _logAsyncInterceptor.ToInterceptor().Intercept(invocation);
        }
    }
}
